package cate.game.play.buff.h;

import cate.game.play.buff.BuffHandler;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.fighter.Fighter;
import cate.game.play.proce.action.ctx.ActionCtx;

/**
 * 【悬赏】目标阵亡后，我方全体恢复10%的生命，【悬赏】状态不能叠加。
 */
public class 悬赏BH extends BuffHandler {

	private double 系数;

	//系数=1000
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		系数 = args.getWDouble("系数", 0d);
	}

	@Override
	public void onDead(ActionCtx action, Fighter killer) {
		for (Fighter target : action.getTeamVs().getEnemyTeam(buff.owner.team).getFightersAlive()) {
			double value = target.attr.total().hpTotal()*系数;
			target.attr.buffHeal(action, buff.caster, value);
		}
	}
}
